home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-04-05 | 2.5 KB | 46 lines | [TEXT/MMCC] |
- //------------------------------------------------------------------------------
- // File: gworld.h
- // Date: 8/23/94
- // Author: Bretton Wade
- //
- // Description: this file contains the class definition for a gworld widget.
- //
- //------------------------------------------------------------------------------
-
- #include "window.h"
-
- #ifndef GWORLD
- #define GWORLD
-
- //------------------------------------------------------------------------------
- // enumerations
- //------------------------------------------------------------------------------
- enum gw_erase {DONT_ERASE = 0, ERASE = 1}; // type flag to tell the gworld to erase the buffer or not when drawing starts
- enum gw_update {DONT_UPDATE = 0, UPDATE = 1}; // type flag to tell the gworld to update the window or not when drawing stops
-
- //------------------------------------------------------------------------------
- // classes
- //------------------------------------------------------------------------------
- class gworld : public widget // gworld widget class
- { // begin
- private: // members internal to this class only
- protected: // members internal to this class hierarchy
- GWorldPtr world; // the gworld
- PixMapHandle pixmap; // handle to the pixels of the gworld
- GrafPtr owner; // the port of the window using the offscreen buffer
- GDHandle curworld; // storage for the world in use when drawing begins
- CGrafPtr curport; // storage for the port in use when drawing begins
- public: // members available externally
- gworld (window*); // constructor
- virtual ~gworld (void); // destructor
- virtual void SetCursor (void); // set the cursor to the correct shape
- virtual void Resize (EventRecord&); // recompute sizing information from parent
- virtual void StartDrawing (gw_erase = ERASE); // lock down the gworld and set the port appropriately
- virtual void StopDrawing (gw_update = UPDATE); // unlock the gworld and reset the port
- virtual void Draw (void); // draw the widget
- }; // end
-
- //------------------------------------------------------------------------------
-
- #endif //GWORLD
-